﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DAO;
using DTO;
using BUS;
namespace QLKS
{
    public partial class frmTraCuuPhong : Form
    {
        PhongBUS bus_Phong;
        LoaiPhongBUS bus_LoaiPhong;
        //TinhTrangBUS bus_TinhTrang;
        public frmTraCuuPhong()
        {
            InitializeComponent();
            bus_Phong = new PhongBUS();
            bus_LoaiPhong = new LoaiPhongBUS();
           // bus_TinhTrang = new TinhTrangBUS();
        }

        private void frmTraCuuPhong_Load(object sender, EventArgs e)
        {
            // Load data for cbTenPhong
            //List<PhongDTO> ltPhong = PhongBUS.getAllData();
            PhongDTO tPhong = new PhongDTO();
            tPhong.MaLoaiPhong = 0;
            tPhong.TenPhong = "<Tất cả>";
            //ltPhong.Insert(0, tPhong);
            cbbTenPhong.DataSource = PhongBUS.getAllData();
            cbbTenPhong.DisplayMember = "TenPhong";
            cbbTenPhong.ValueMember = "TenPhong";

            // Load data for cbLoaiPhong
            //List<LoaiPhong> ltLoaiPhong = bus_LoaiPhong.ChonTatCa();
            LoaiPhongDTO tLoaiPhong = new LoaiPhongDTO();
            tLoaiPhong.MaLoaiPhong = 0;
            tLoaiPhong.TenLoaiPhong = "<Tất cả>";
            //ltLoaiPhong.Insert(0, tLoaiPhong);

            cbbLoaiPhong.DataSource = LoaiPhongBUS.GetAll();
            cbbLoaiPhong.DisplayMember = "TenLoaiPhong";
            cbbLoaiPhong.ValueMember = "MaLoaiPhong";

            //// Load data for cbTinhTrang
            //List<TinhTrang> ltTinhTrang = bus_TinhTrang.ChonTatCa();
            //TinhTrang tTinhTrang = new TinhTrang();
            //tTinhTrang.MaTinhTrang = 0;
            //tTinhTrang.TenTinhTrang = "<Tất cả>";
            //ltTinhTrang.Insert(0, tTinhTrang);

            //cbTinhTrang.DataSource = ltTinhTrang;
            //cbTinhTrang.DisplayMember = "TenTinhTrang";
            //cbTinhTrang.ValueMember = "MaTinhTrang";

            // Load data for dgvPhong
            //p_LoaiPhong.DataSource = LoaiPhongBUS.GetAll();
            //p_LoaiPhong.DisplayMember = "TenLoaiPhong";
            //p_LoaiPhong.ValueMember = "MaLoaiPhong";

            ////p_TinhTrang.DataSource = 
            ////p_TinhTrang.DisplayMember = "TenTinhTrang";
            ////p_TinhTrang.ValueMember = "MaTinhTrang";

            //p_DonGia.DataSource = LoaiPhongBUS.GetAll();
            //p_DonGia.DisplayMember = "DonGia";
            //p_DonGia.ValueMember = "MaLoaiPhong";
            
        }

        private void btnTim_Click(object sender, EventArgs e)
        {
            
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }        
    }
}
